<template>
	<view class="notice-box" v-if="load">
		<view class="item-notice-box" v-for="(item,key) in list" :key="key" @click="toDetail(item.id)">
			<view class="item-notice-title">
				{{item.title}}
			</view>
			<view class="item-notice-time">
				{{item.create_time}}
			</view>
		</view>
	</view>
</template>

<script>
	export default{
			data(){
				return {
					load : false,
					list :[],
				}
			},
			onLoad(e) {
				this.getData();
			},
			methods:{
				getData(){
					uni.showLoading({
						title:'加载中'
					})
					this.ajax('index/getNotice',{
						data:{},
						success:(res) => {
							uni.hideLoading();
							this.list = res.msg;
							this.load = true;
							
						}
					});
				},
				toDetail(id){
					uni.navigateTo({
						url:'/pages/index/detail?id='+id
					})
				}
			}
		}
	</script>
	

<style>
	@import url("@/static/css/index/notice.css");
</style>